<script>
function checkprivs() {
	if (document.adduserdb.ALTER.checked == true ||
		document.adduserdb.CREATETEMPORARYTABLES.checked == true ||
		document.adduserdb.CREATE.checked == true ||
		document.adduserdb.DELETE.checked == true ||
		document.adduserdb.DROP.checked == true ||
		document.adduserdb.SELECT.checked == true ||
		document.adduserdb.INSERT.checked == true ||
		document.adduserdb.UPDATE.checked == true ||
		document.adduserdb.REFERENCES.checked == true ||
		document.adduserdb.INDEX.checked == true ||
		document.adduserdb.LOCKTABLES.checked == true) {
	        document.adduserdb.ALL.checked = false;
	}
}

function checkallprivs() {
	if (document.adduserdb.ALL.checked == true) {
		document.adduserdb.ALTER.checked=false;
		document.adduserdb.CREATETEMPORARYTABLES.checked=false;
		document.adduserdb.CREATE.checked=false;
		document.adduserdb.DELETE.checked=false;
		document.adduserdb.DROP.checked=false;
		document.adduserdb.SELECT.checked=false;
		document.adduserdb.INSERT.checked=false;
		document.adduserdb.UPDATE.checked=false;
		document.adduserdb.REFERENCES.checked=false;
		document.adduserdb.INDEX.checked=false;
		document.adduserdb.LOCKTABLES.checked=false;
	}

}
</script>

<div id="navigation">
	<a href="{U_HOME}">{DOMAIN} {L_CPANEL_INDEX}</a> ::
	{L_MYSQL_DATABASES}
</div><br />

{L_MYSQL_INTRO}<br /><br />

{L_PHPMYADMIN_INTRO} <a href="{U_PHPMYADMIN}">phpMyAdmin</a>.<br /><br />

<table width=100%>
<tr>
	<th>{L_DATABASE_NAME}</th>
	<th>{L_DATABASE_ACTIONS}</th>
	<th>{L_DATABASE_USERS}</th>
</tr>
<!-- BEGIN databaserow -->
<tr class={databaserow.ROWCLASS}>
	<td>{databaserow.NAME}</td>
	<td><a href="{databaserow.U_DELETE}">{L_DELETE}</a> :: <a href="{databaserow.U_CHECK}">{L_CHECK}</a> :: <a href="{databaserow.U_REPAIR}">{L_REPAIR}</a></td>
	<td>
<!-- BEGIN userrow -->
	{databaserow.userrow.NAME} ({databaserow.userrow.PRIVS}) (<a href="{databaserow.userrow.U_DELETE}">{L_REMOVE}</a>)<br />
<!-- END userrow -->
	</td>

</tr>
<!-- END databaserow -->
</table><br /><br />

<div class=row1 align=center>
<b>{L_LINK_USER_DATABASE}</b>
</div>
{L_LINK_USER_DATABASE_INTRO}<br /><br />
<form action="{S_ADD_USER_TO_DB_ACTION}" name=adduserdb>
<table align=center>
<tr>
	<td>{L_USER}:</td>
	<td colspan=2>{S_CHOOSE_USER}</td>
</tr>
<tr>
	<td>{L_DATABASE}:</td>
	<td colspan=2>{S_CHOOSE_DATABASE}</td>
</tr>
<tr>
	<td valign=top>{L_PRIVILEGES}:</td>
	<td>
<input type=checkbox name="ALL" value="ALL" checked onClick="checkallprivs();"> {L_ALL}<br />
<input type=checkbox name="ALTER" value="ALTER" onClick="checkprivs();"> {L_ALTER}<br />
<input type=checkbox name="CREATETEMPORARYTABLES" value="TEMPORARY" onClick="checkprivs();"> {L_CREATE_TEMPORARY_TABLES}<br />
<input type=checkbox name="CREATE" value="CREATE" onClick="checkprivs();"> {L_CREATE}<br />
<input type=checkbox name="DELETE" value="DELETE" onClick="checkprivs();"> {L_DELETE}<br />
<input type=checkbox name="DROP" value="DROP" onClick="checkprivs();"> {L_DROP}</td><td>
<input type=checkbox name="SELECT" value="SELECT" onClick="checkprivs();"> {L_SELECT}<br />
<input type=checkbox name="INSERT" value="INSERT" onClick="checkprivs();"> {L_INSERT}<br />
<input type=checkbox name="UPDATE" value="UPDATE" onClick="checkprivs();"> {L_UPDATE}<br />
<input type=checkbox name="REFERENCES" value="REFERENCES" onClick="checkprivs();"> {L_REFERENCES}<br />
<input type=checkbox name="INDEX" value="INDEX" onClick="checkprivs();"> {L_INDEX}<br />
<input type=checkbox name="LOCKTABLES" value="LOCK" onClick="checkprivs();"> {L_LOCK_TABLES}<br />
	</td>
</tr>
<tr>
	<td colspan=3 align=center><input type=submit value="{L_LINK_USER_DATABASE}"></td>
</tr>
</table>
</form><br />

<div class=row1 align=center>
<b>{L_CREATE_DATABASE}</b>
</div>
<form action="{S_ADD_DB_ACTION}">
<table align=center>
<tr>
	<td>{L_DATABASE_NAME}:</td>
	<td><input type="text" name="db"></td>
</tr>
<tr>
	<td colspan=2 align=center><input type=submit value="{L_CREATE_DATABASE}"></td>
</tr>
</table>
</form><br />


<div class=row1 align=center>
<b>{L_USERS}</b>
</div>
{L_DATABASE_USERS_INTRO}<br /><br />
<table align=center width=50%>
<tr>
	<th>{L_USERNAME}</th>
	<th>{L_ACTIONS}</th>
</tr>
<!-- BEGIN listuserrow -->
<tr class={listuserrow.ROWCLASS}>
	<td align=center>{listuserrow.NAME}</td>
	<td align=center><a href="{listuserrow.U_DELETE}">{L_DELETE}</a></td>
</tr>
<!-- END listuserrow -->
</table><br />
<form action="{S_ADD_USER_ACTION}">
<table align=center>
<tr>
	<td>{L_USERNAME}:</td>
	<td><input type="text" name="user"></td>
</tr>
<tr>
	<td>{L_PASSWORD}:</td>
	<td><input type="password" name="pass"></td>
</tr>
<tr>
	<td colspan=2 align=center><input type=submit value="{L_ADD_USER}"></td>
</tr>
</table>
</form><br /><br />

<div class=row1 align=center>
<b>{L_ACCESS_HOSTS}</b>
</div>
{L_ACCESS_HOSTS_INTRO}<br /><br />


<table align=center width=50%>
<tr>
	<th>{L_ADDRESS}</th>
	<th>{L_ACTIONS}</th>
</tr>
<!-- BEGIN listhostrow -->
<tr class={listhostrow.ROWCLASS}>
	<td align=center>{listhostrow.NAME}</td>
	<td align=center>
	<!-- BEGIN showdelete -->
	<a href="{listhostrow.showdelete.U_DELETE}">{L_DELETE}</a>
	<!-- END showdelete -->
	</td>
</tr>
<!-- END listhostrow -->
</table><br />

<form action="{S_ADD_ACCESS_HOST_ACTION}">
<table align=center>
<tr>
	<td align=center>{L_HOST}:</td>
	<td align=center><input type="text" name="host"></td>
</tr>
<tr>
	<td colspan=2 align=center><input type=submit value="{L_ADD_HOST}"></td>
</tr>
</table>
</form>